<!--
 * @Author: zls 3292844045@qq.com
 * @Date: 2022-05-26 08:57:39
 * @LastEditors: zls 3292844045@qq.com
 * @LastEditTime: 2022-05-27 15:19:27
 * @FilePath: \CUCCL\html\detail.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>详情——古驰GUCCI中国官方网站</title>
    <link
      rel="stylesheet"
      href="https://at.alicdn.com/t/font_3418519_67alwcgubot.css"
    />
    <link rel="stylesheet" href="../css/init_css/reset.css" />
    <link rel="stylesheet" href="../css/details/details.css" />
    <link rel="stylesheet" href="../css/main_css/main.css" />
    <link rel="stylesheet" href="../css/female_cloths/female_cloths.css" />
    <script src="https://cdn.acwing.com/static/jquery/js/jquery-3.3.1.min.js"></script>
  </head>
  <body>
    <!-- 头部部分 -->
    <header class="splice-header">
      <div class="splice-container header-transparent">
        <nav class="splice-navbar">
          <!-- logo部分 -->
          <div class="splice-navbar-top">
            <!-- 三部分, 左侧 中间 右侧 -->
            <div class="splice-navbar-left">
              <ul>
                <li>
                  <a href="">
                    <i
                      class="iconfont icon-wxbdingwei"
                      style="opacity: 0.5"
                    ></i>
                    <span>配送至：</span>
                    <span>中国大陆地区</span>
                  </a>
                  <!-- 鼠标滑过显示下方隐藏的div -->
                  <!-- <div class="splice-sub-menu splic-sub-menu-hidden">
                          <h6>网上商城</h6>
                          <p>请注意，在浏览过程中更改您的位置将会清除购物袋中的所有商品。</p>
                      </div> -->
                </li>
                <li>
                  <a href="">
                    <span>客户服务</span>
                  </a>
                </li>
                <li>
                  <a href="">
                    <i class="iconfont icon-dianhua"></i>
                    <span>400.8210.582</span>
                  </a>
                </li>
              </ul>
            </div>

            <div class="splice-navbar-right">
              <a class="login">登录</a>
              <!-- //心愿单 -->
              <a href="" class="splice-nav-savedItems">
                <i class="iconfont icon-icon"></i>
              </a>
              <!-- 购物车 -->
              <a href="../html/cart.html" class="shopping-cart">
                <i class="iconfont icon-gouwudai"></i>
                <span>购物车</span>
              </a>

              <!-- //搜索框 -->
              <a class="header-search"> </a>
            </div>
            <div class="splice-navbar-logo">
              <a href="https://www.gucci.cn/zh/">
                <img
                  src="https://res.gucci.cn/images/common/gucci-logo@2x.png"
                  alt="GUCCI"
                />
              </a>
            </div>
          </div>
          <!-- logo下面菜单 -->
          <div class="splice-navbar-menu">
            <ul class="splice-nav">
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">全球资讯</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">手袋</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="./female.html">
                  <span class="navtitletxt">女士</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">男士</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">童装</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">礼品</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">珠宝和腕表</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">美妆</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
              <li class="splice-nav-menu">
                <a href="">
                  <span class="navtitletxt">生活和艺术</span>
                </a>
                <!-- 滑过显示德部分 -->
                <div class="splice-nav-hid"></div>
              </li>
            </ul>
          </div>
        </nav>
      </div>
    </header>
    <!-- 主体部分-->
    <section>
      <div class="goods_details">
        <!-- 左边图片 -->
        <!-- <div class="left_img">
                <img src="https://res.gucci.cn/resources/2022/3/24/1648093322960354_ts_470X470.png" alt="">
            </div>
            <div class="details">
                <h3>花卉印花平纹细布连衣裙</h3>
                <div class="buy">
                    <p>￥28000</p>
                    <span>花呗分期免息产品</span>
                </div>
               <div class="goods_mode">
                   <span>款号704251 ZAJAB 5713</span>
                   <div class="goods_color">
                       <img src="https://res.gucci.cn/resources/2022/3/24/1648093322960354_ts_470X470.png" alt="">
                       <span>淡粉色</span>
                   </div>
                   <div class="goods_size">
                       <select name="" id="">
                        <option value="">选择合适的尺码</option>
                           <option value="XXS">XXS</option>
                           <option value="XS">XS</option>
                           <option value="S">S</option>
                           <option value="L">L</option>
                           <option value="XL">XL</option>
                           <option value="XXL">XXL</option>
                       </select>
                   </div>

                   <div class="add">
                       <a href="">
                           加入购物袋
                       </a>
                       
                   </div>
                   <div class="pay">
                        <a href="">
                            微信快捷支付
                        </a>
                   </div>
               </div>

            </div> -->
      </div>
    </section>
    <!-- 尾部 -->
    <footer class="splice_footer">
      <!-- 尾部主体 -->
      <div class="splice_container">
        <!-- 返回顶部 -->
        <!-- <div class="splice_back_top">
        <i class="iconfont icon-xiangshangjiantou"></i>
        </div> -->
        <!-- 尾部内容 -->
        <div class="splice_footer_content">
          <!-- 左边 -->
          <div class="splice_footer_left">
            <ul>
              <!-- 免费服务 -->
              <li class="spice_exclusive_service">
                <div class="spice_footer_title">
                  <span>专属服务</span>
                </div>
                <ul class="spice_all">
                  <li><span>免费标准配送</span></li>
                  <li><span>免费礼品包装</span></li>
                  <li><span>预约门店服务</span></li>
                </ul>
              </li>
              <!-- 购买帮助 -->
              <li class="spice_shoping_help">
                <div class="spice_footer_title">
                  <span>购物帮忙</span>
                </div>
                <ul>
                  <li>
                    <a href="">
                      <span>支付相关</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>配送</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>退换货</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>发票</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>保养与维修</span>
                    </a>
                  </li>
                </ul>
              </li>
              <!-- 关于公司 -->
              <li class="spice_about_company">
                <div class="spice_footer_title">
                  <span>关于公司</span>
                </div>

                <ul>
                  <li>
                    <a href="">
                      <span>关于GUCCI</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>GUCCI EQUILIBRIUM</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>道德规范</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>职业发展</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>细则及条款</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>隐私与COOKIE</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>企业信息</span>
                    </a>
                  </li>
                </ul>
              </li>
              <!-- 联系方式 -->
              <li class="spice_follow_gucci">
                <div class="spice_footer_title">
                  <span>关注GUCCI</span>
                </div>
                <ul>
                  <li>
                    <a href="">
                      <span>微信</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>微博</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>抖音</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>腾讯视频</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>小红书</span>
                    </a>
                  </li>

                  <li class="slice_footer_tails">
                    <a href="">
                      <span>在线顾问</span>
                    </a>
                  </li>
                  <li class="slice_footer_tails">
                    <a href="">
                      <span>400.8210.582</span>
                    </a>
                  </li>
                </ul>
              </li>
              <!-- 需要帮助 -->
              <li class="spice_need_help">
                <div class="spice_footer_title">
                  <span>需要帮助?</span>
                </div>
                <ul>
                  <li>
                    <a href="">
                      <span>联系我们</span>
                    </a>
                  </li>
                  <li>
                    <a href="">
                      <span>常见问题</span>
                    </a>
                  </li>
                </ul>
              </li>
            </ul>
          </div>
          <!-- 右边 -->
          <div class="splice_footer_right">
            <div class="splice_footer_right_content">
              <div class="spice_form_group">
                <div class="spice_form_title">订阅GUCCI电子资讯</div>
                <div class="spice_form_content">
                  <p class="spice_form_info">
                    通过订阅，即代表您接受GUCCI的
                    <a href=""> 隐私政策条款 </a>
                  </p>
                  <div class="spice_form_input">
                    <input
                      type="text"
                      name=""
                      id=""
                      placeholder="电子邮件地址"
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </footer>

    <script src="../js/api.js"></script>
    <script>
      // 获取标签对象
      // 标题部分
      const $splice_nav = $(".splice-container");
      $splice_nav.on("mouseover", () => {
        $splice_nav.addClass("_bgactive");
      });

      $splice_nav.on("mouseout", () => {
        $splice_nav.removeClass("_bgactive");
      });
      // 鼠标滚动收起
      $(window).scroll(() => {
        // console.log();
        if ($(document).scrollTop() >= 20) {
          // console.log(1);
          $(".splice-container").removeClass("header-transparent");
          $(".splice-container").addClass("_compressed ");
        } else {
          $(".splice-container").removeClass("_compressed ");
          $(".splice-container").addClass("header-transparent");
        }
      });

      // 显示详情信息
      let html = "";
      let id = queryString("cloths_id");
      if(!id){
        location.href = 'female_cloths.html';
      }
      let login_user = localStorage.getItem("LOGIN_NAME");
      console.log(id);

      let detail_add = async () => {
        let res = await cloths_details({
          cloths_id: id,
        });
        console.log(res);

        html += `
        <div class="left_img">
                <img src=${res["list"].cloths_img} alt="">
            </div>
            <div class="details">
                <h3>${res["list"].cloths_name}</h3>
                <div class="buy">
                    <p>￥${res["list"].cloths_prices}</p>
                    <span>花呗分期免息产品</span>
                </div>
               <div class="goods_mode">
                   <span>款号704251 ZAJAB 5713</span>
                   <div class="goods_color">
                       <img src=${res["list"].cloths_img} alt="">
                       <span>${res["list"].cloths_color}</span>
                   </div>
                   <div class="goods_size">
                       <select name="" id="">
                        <option value="">选择合适的尺码</option>
                           <option value="XXS">XXS</option>
                           <option value="XS">XS</option>
                           <option value="S">S</option>
                           <option value="L">L</option>
                           <option value="XL">XL</option>
                           <option value="XXL">XXL</option>
                       </select>
                   </div>

                   <div class="add">
                       <a>
                           加入购物袋
                       </a>
                       
                   </div>
                   <div class="pay">
                        <a>
                            微信快捷支付
                        </a>
                   </div>
               </div>

            </div>
        `;
        // console.log(html);
        $(".goods_details").html(html);

        // 加入购物车
        console.log(login_user);
        $(".add").on("click", async () => {
          if (login_user) {
            console.log($("select").val());
            console.log(1);
            let size = $("select").val();
            let res = await add({
              // 商品id
              cloths_id: id,
              // 用户名称
              login_user: login_user,
              //商品数量
              num: 1,
              size
            });
            console.log(res);
            alert(res["msg"]);
          } else {
            location.href = "./login.html";
            alert("请登录网站");
          }
        });
      };
      detail_add();

      if (login_user) {
        $(".login").html("我的账户");
        // $('.login').attr('href',  "../html/login.html");
      } else {
        $(".login").attr("href", "../html/login.html");
      }
    </script>
  </body>
</html>
